import {getMerchantCategory as _getMerchantCategory} from "@/api/pointsMall";
import {IMerchantCategoryOption, IStoreGoodsPageDataOption} from "@/api/modules/pointsMall";


export function useGetMerchantCategory() {
  const merchantCategory = ref<IMerchantCategoryOption[]>([])

  const getMerchantCategory = async(data:IStoreGoodsPageDataOption) => {
    const rs = await _getMerchantCategory(data)

    if (rs.code === 200) {
      merchantCategory.value = rs.payload ?? []
    }
  }

  return {
    merchantCategory,
    getMerchantCategory
  }
}
